# a CMake that works with pylon cam and OpenCV project
# created 05/11/14
# author: Shawn Le

cmake_minimum_required(VERSION 2.8)
project( still_cam_calib ) 

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
												"D:/Program Files/Basler/pylon 4"
												"D:/Documents and Settings/SonLe/My Documents/SOFTs/OpenCV-2.4.2/opencv/build/"
)												

set(OpenCV_DIR "D:/opencv/build")
#set(OpenCV_DIR "D:/Documents and Settings/SonLe/My Documents/SOFTs/OpenCV-2.4.2/opencv/build/")

# find_package calls CMake module, if I don't use find_package, I can use target_link_libraries & link_directories combination instead
find_package( OpenCV REQUIRED core highgui imgproc objdetect calib3d features2d ml flann nonfree video contrib gpu legacy photo ts stitching) # 


# check finding
IF (OpenCV_FOUND)
message("OpenCV is found\n")
ELSE (OpenCV_FOUND)
message("OpenCV is NOT found\n")
ENDIF (OpenCV_FOUND)


include_directories(${OpenCV_INCLUDE_DIRS})

# NO  NEED  AFTER CALLING find_package, it depends on specific library's CMake module
#link_directories(   ${OpenCV_LIB_DIR} 
#								${PYLON_LIBRARIES}
#								"D:/Program Files/Basler/pylon 4/pylonc/lib/Win32"
#								"D:/Program Files/Basler/pylon 4/genicam/library/cpp/lib/win32_i86"
#)


message("OpenCV_LIB_DIR = ${OpenCV_LIB_DIR}")
message("OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}")
message("OpenCV_DIR = ${OpenCV_DIR}")
message("OpenCV_LIBS = ${OpenCV_LIBS}")
#message("PYLON_LIBRARIES = ${PYLON_LIBRARIES}")

add_executable( still_cam_calib main_still_calib.cpp)


# here only put the library names without path, coz' path is given in link_directories
target_link_libraries( still_cam_calib ${OpenCV_LIBS})
